package com.csgsystems.im.module.action.example;

import com.csgsystems.im.survey.Survey;

public class DeleteAction extends ExampleBaseAction {


	/**
	 *
	 */
	private static final long serialVersionUID = -1113024142143945181L;

	@Override
	public String execute() throws Exception {
		Survey model = (Survey) getSession().getAttribute("entityModel"); // Set via ViewAction
		model.setName(model.getName() + "-D");

		getSession().removeAttribute("entityModel");
		
		String returnValue = ERROR;
		
		try {
		   surveyDao.update(model.getId(), model);
		   returnValue = SUCCESS;
		} catch (Exception e) {
			addActionError(e.getMessage());	
			e.printStackTrace();
		}

		return returnValue;

	}



}
